package com.yxq.mdt.app.modules.personal.adapter;

import android.widget.ImageView;

import com.blankj.utilcode.util.TimeUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yxq.mdt.app.R;
import com.yxq.mdt.app.glide.GlideHelper;
import com.yxq.mdt.app.modules.personal.bean.RecordUserListBean;

import java.text.SimpleDateFormat;
import java.util.List;

/**
 * @author L
 * @time
 * @describe 谁看过我
 */
public class PersonalBrowsingHistoryListAdapter extends BaseQuickAdapter<RecordUserListBean.ListBean, BaseViewHolder> {

    public PersonalBrowsingHistoryListAdapter(int layoutResId, List<RecordUserListBean.ListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, RecordUserListBean.ListBean item) {
        ImageView icon = helper.getView(R.id.personal_item_img);
        GlideHelper.setLoadRoundImage(mContext, item.getHeadimg(), R.mipmap.head_icon, icon);
        helper.setText(R.id.item_layout_nike_name, item.getGaName());
        //性别
        helper.setImageResource(R.id.item_iv_sex, item.getSex() == 1 ? R.mipmap.xb_nan : R.mipmap.xb_nv);
        //发布时间
        helper.setText(R.id.item_layout_attention,item.getCreateTime());

        helper.setText(R.id.item_layout_province,String.format("访问主页%d次，帖子%d次，商品%d次",item.getUserExtNum(),item.getTopicNum(),item.getGoodsNum()));
    }
}
